import urllib.request
import re

def getIP():
    print("we will try to open this url, in order to get IP Address")
    url = "http://mwburden.com/cgi-bin/getipaddr"
    print(url)
    request = urllib.request.urlopen(url).read()
    theIP = re.search(r"\d{1,3}\.\d{1,3}\.\d{1,3}.\d{1,3}", request.decode('utf-8')).group()
    print("当前外网ip:"+theIP)
    return theIP